package com.cyc.service.impl;

import com.cyc.dao.CommentMapper;
import com.cyc.entity.Comment;
import com.cyc.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    protected CommentMapper commentMapper;

    @Override
    public List<Comment> selectAll() {
        return commentMapper.selectAll();
    }

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return commentMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int deleteByProductId(Integer id) {
        return commentMapper.deleteByProductId(id);
    }

    @Override
    public int deleteByUserId(Integer id) {
        return commentMapper.deleteByUserId(id);
    }

    @Override
    public int updateByPrimaryKey(Comment record) {
        return commentMapper.updateByPrimaryKey(record);
    }

    @Override
    public int insert(Comment record) {
        return commentMapper.insert(record);
    }
}
